import { http } from "@/utils/http";

/**
 流程接口
 **/
// 可视化位置树--左侧树
export const queryFacPositionTree = (data: object) => {
  return http.request("post", `/digitaltwins/api/v1/visualFacPosition/queryFacPositionTree`, {
    data
  });
};
//可视化位置树--中间树
export const listByTwinId = (twinId?: string) => {
  return http.request("get", `/digitaltwins/api/v1/visualComponent/listByTwinId/${twinId}`);
};
// 分页查询
export const queryPageList = (data: object) => {
  return http.request("post", `/digitaltwins/api/v1/visualComponentAttr/pageList`, {
    data
  });
};
// 新增组件
export const save = (data: object) => {
  return http.request("post", `/digitaltwins/api/v1/visualComponent/save`, {
    data
  });
};
// 删除组件
export const delByComponentNo = (componentNo?: string) => {
  return http.request("post", `/digitaltwins/api/v1/visualComponent/delByComponentNo/${componentNo}`);
};
// 新增属性
export const saveOrUpdate = (data: object) => {
  return http.request("post", `/digitaltwins/api/v1/visualComponentAttr/saveOrUpdate`, {
    data
  });
};
// 批量新增属性
export const batchSaveOrUpdate = (data: object) => {
  return http.request("post", `/digitaltwins/api/v1/visualComponentAttr/batchSaveOrUpdate`, {
    data
  });
};
// 删除属性
export const delByIds = (data?: object) => {
  return http.request("post", `/digitaltwins/api/v1/visualComponentAttr/delByIds`, {
    data
  });
};
